package com.iring.service.common.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.iring.dao.common.LocationDao;
import com.iring.domain.common.Location;
import com.iring.exception.ParamInvalidException;
import com.iring.service.common.LocationService;

/**
 * @author wanggan
 **/
@Service
public class LocationServiceImpl implements LocationService {

    @Autowired
    LocationDao locationDao;

    @Override
    public List<Location> getByParentId(Integer parentid) {
        if(null == parentid){
            throw new ParamInvalidException("parentId is null");
        }
        return locationDao.getByParentId(parentid);
    }
}
